package com.itheima.d7_IO.Change;


import java.io.*;

public class Test3 {
    public static void main(String[] args) throws Exception {
        //Writer writer = new FileWriter("E:\\FileResource\\NewFile.txt");

         OutputStream fileOutputStream = new FileOutputStream("E:\\FileResource\\NewFile.txt");
         //指定GBK方式写字符
         OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream,"GBK");
         // 包装一下
         BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
         bufferedWriter.write("中文");
         bufferedWriter.close();
    }
}
